import Vue from 'vue'
import Router from 'vue-router'
import Login from "@/components/Login";
import Manager from "@/components/Manager";
import BookList from "@/components/book/BookList";
import AddBook from "@/components/book/AddBook";
import CategoryList from "@/components/book/CategoryList";
import AddCategory from "@/components/book/AddCategory";
import SecondhandList from "@/components/book/SecondhandList";
import AddSecondhand from "@/components/book/AddSecondhand";
import MyCart from "@/components/cart/MyCart";
import MyAddress from "@/components/cart/AddressList";
import addAddress from "@/components/cart/AddAddress";
import MyOrder from "@/components/cart/OrderList";
import Volume from "@/components/book/Volume";
import UserList from "@/components/order/UserList";
import OrderList from "@/components/order/OrderList";
import register from "@/components/register";

Vue.use(Router)

export default new Router({
  routes: [
    {path: "/", component: Login},
    {path: "/register", component: register},
    {
      path: "/manager", component: Manager,
      children:[
        {path: "/book/BookList", component: BookList},
        {path: "/book/AddBook", component: AddBook},
        {path: "/book/CategoryList", component: CategoryList},
        {path: "/book/AddCategory", component: AddCategory},
        {path: "/book/SecondhandList", component: SecondhandList},
        {path: "/book/AddSecondhand", component: AddSecondhand},
        {path: "/cart/MyCart", component: MyCart},
        {path: "/cart/MyAddress", component: MyAddress},
        {path: "/cart/addAddress", component: addAddress},
        {path: "/cart/MyOrder", component: MyOrder},
        {path: "/book/Volume", component: Volume},
        {path: "/order/OrderList", component: OrderList},
        {path: "/order/UserList", component: UserList},
      ]
    }
  ]
})
